package com.landary.parameterrplacement.webservice;

import org.apache.axis.client.Stub;

import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import java.net.URL;
import java.rmi.Remote;
import java.util.HashSet;
import java.util.Iterator;

/**
 * @author 刘欣
 * @createTime 2023/8/9 16:02
 * @description
 */
public class UUMS_ServiceImplServiceLocator extends org.apache.axis.client.Service implements UUMS_ServiceImplService {

    public UUMS_ServiceImplServiceLocator() {

    }

    public UUMS_ServiceImplServiceLocator(org.apache.axis.EngineConfiguration configuration) {
        super(configuration);
    }

    public UUMS_ServiceImplServiceLocator(String wsdl, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdl, sName);
    }

    private String UUMS_ServiceImplPort_address = "http://192.9.111.182:58080/yhgl/webservice/UUMS_LDAPService?wsdl";

    private String UUMS_ServiceImplPortWSDDServiceName = "UUMS_ServiceImplPort";


    private String getUUMS_ServiceImplPortWSDDServiceName() {
        return UUMS_ServiceImplPortWSDDServiceName;
    }

    @Override
    public String getUUMS_ServiceImplPortAddress() {
        return UUMS_ServiceImplPort_address;
    }

    @Override
    public UUMS_Service getUUMS_ServiceImplport() throws ServiceException {
        java.net.URL endpoint;
        try {
            endpoint = new URL(UUMS_ServiceImplPort_address);
        } catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getUUMS_ServiceImplport(endpoint);
    }

    @Override
    public UUMS_Service getUUMS_ServiceImplport(URL portAddress) throws ServiceException {
        try {
            UUMS_ServiceImplServiceSoapBindingStub _stub = new UUMS_ServiceImplServiceSoapBindingStub(portAddress, this);
            _stub.setPortName(getUUMS_ServiceImplPortWSDDServiceName());
            return _stub;
        } catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }

    public void setUUMS_ServiceImplPortEndpointAddress(String address) {
        UUMS_ServiceImplPort_address = address;
    }

    public Remote getPort(Class serviceEndpointInterface) throws ServiceException {
        try {
            if (UUMS_Service.class.isAssignableFrom(serviceEndpointInterface)) {
                UUMS_ServiceImplServiceSoapBindingStub _sub = new UUMS_ServiceImplServiceSoapBindingStub(new URL(UUMS_ServiceImplPort_address), this);
                _sub.setPortName(getUUMS_ServiceImplPortWSDDServiceName());
                return _sub;
            }
        } catch (Throwable throwable) {
            throw new javax.xml.rpc.ServiceException(throwable);
        }
        throw new ServiceException("The is no stub implementation for the interface:" + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }

    public Remote getPort(QName protName, Class serviceEndpointInterface) throws ServiceException {
        if (protName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = protName.getLocalPart();
        if ("UUMS_ServiceImplPort".equals(inputPortName)) {
            return getUUMS_ServiceImplport();
        } else {
            Remote _stub = getPort(serviceEndpointInterface);
            ((Stub) _stub).setPortName(protName);
            return _stub;
        }
    }

    public QName getServiceName() {
        return new QName("http://webService.impl.service.avicit.com/", "UUMS_ServiceImplService");
    }

    private HashSet ports = null;

    public Iterator getPorts() {
        if (ports == null) {
            ports = new HashSet();
            ports.add(new QName("http://webService.impl.service.avicit.com/", "UUMS_ServiceImplPort"));
        }
        return ports.iterator();
    }

    public void setEndpointAddress(String portName, String address) throws ServiceException {
        if ("UUMS_ServiceImplPort".equals(portName)) {
            setUUMS_ServiceImplPortEndpointAddress(address);
        } else {
            throw new ServiceException("Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }

    public void setEndpointAffress(QName portName, String address) throws ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }

    public void setUUMS_ServiceImplPortWSDDServiceName(String name) {
        UUMS_ServiceImplPortWSDDServiceName = name;
    }
}
